export const API_BASE_URL = 'http://192.168.2.63:8080'; // 开发环境地址
export const API_VERSION = 'v1';
export const API_TIMEOUT = 10000; // 10 秒超时

export const API_ENDPOINTS = {
  // 用户管理
  REGISTER: '/api/v1/users/register',
  LOGIN: '/api/v1/users/login',
  LOGOUT: '/api/v1/users/logout',
  GET_USER: (userId: number) => `/api/v1/users/${userId}`,
  UPDATE_USER: (userId: number) => `/api/v1/users/${userId}`,
  RESET_PASSWORD: '/api/v1/users/reset-password/',
  GET_ROLES: '/api/v1/users/roles/list',
  UPDATE_USER_ROLE: (userId: number) => `/api/v1/users/${userId}/role`,

  // 作品管理
  GET_TAGS: '/api/v1/artworks/tags/',
  LIST_ARTWORKS: '/api/v1/artworks/',
  CREATE_ARTWORK: '/api/v1/artworks/',
  GET_ARTWORK: (artworkId: number) => `/api/v1/artworks/${artworkId}/`,
  UPDATE_ARTWORK: (artworkId: number) => `/api/v1/artworks/${artworkId}/`,
  DELETE_ARTWORK: (artworkId: number) => `/api/v1/artworks/${artworkId}/`,
  UPDATE_ARTWORK_TAGS: (artworkId: number) => `/api/v1/artworks/${artworkId}/tags/`,

  // 元数据记录
  LIST_METADATA: '/api/v1/metadata/',
  CREATE_METADATA: '/api/v1/metadata/',
  GET_METADATA: (id: number) => `/api/v1/metadata/${id}`,
  UPDATE_METADATA: (id: number) => `/api/v1/metadata/${id}`,
  DELETE_METADATA: (id: number) => `/api/v1/metadata/${id}`,

  // 社区
  LIST_COMMENTS: '/api/v1/community/comments',
  CREATE_COMMENT: '/api/v1/community/comments',
  DELETE_COMMENT: (commentId: number) => `/api/v1/community/comments/${commentId}`,
  UPDATE_COMMENT: (commentId: number) => `/api/v1/community/comments/${commentId}`,
  LIST_TOPICS: '/api/v1/community/topics',
  CREATE_TOPIC: '/api/v1/community/topics',
  GET_TOPIC: (topicId: number) => `/api/v1/community/topics/${topicId}`,
  LIKE_TOPIC: (topicId: number) => `/api/v1/community/topics/${topicId}/like`,
  UNLIKE_TOPIC: (topicId: number) => `/api/v1/community/topics/${topicId}/like`,
  LIST_TOPIC_COMMENTS: (topicId: number) => `/api/v1/community/topics/${topicId}/comments`,
  CREATE_TOPIC_COMMENT: (topicId: number) => `/api/v1/community/topics/${topicId}/comments`,
  UPDATE_TOPIC_COMMENT: (commentId: number) => `/api/v1/community/topics/comments/${commentId}`,
  DELETE_TOPIC_COMMENT: (commentId: number) => `/api/v1/community/topics/comments/${commentId}`,
  LIST_FOLLOWS: '/api/v1/community/follows',
  CREATE_FOLLOW: '/api/v1/community/follows',
  DELETE_FOLLOW: (followId: number) => `/api/v1/community/follows/${followId}`,
  LIST_NOTIFICATIONS: '/api/v1/community/notifications',
  MARK_NOTIFICATION_READ: (notificationId: number) => `/api/v1/community/notifications/${notificationId}/read`,

  // 文件管理
  UPLOAD_FILE: '/api/v1/files/upload',
  LIST_FILES: '/api/v1/files/list',
  DELETE_FILE: (fileId: number) => `/api/v1/files/${fileId}`,
}; 